<?php

/**
 * Description of groupMenuEditAction
 *
 * @author francisc
 */

class groupMenuEditAction extends sfAction {

    public function execute($request) {
        $id = $request->getParameter('id');
        
        $groupMenu = SqlEngine::getMenus(array('restaurant_id' => $this->getUser()->getAttribute('current_restaurant_id'),
                                               'menu_id' => $id));
        
        $this->form = new GroupMenuForm(array('name' => $groupMenu[0]['name'],
                                              'description' => $groupMenu[0]['description']));
        
        return $this->renderPartial('group_menu_edit_form', array('form' => $this->form,
                                                                  'id' => $id));
    }
}
